#!/usr/bin/python2
# -*- coding: utf8 -*-
from PyQt4 import QtCore, QtGui, Qt, QtDeclarative

class BaseTimeModel(QtCore.QAbstractListModel):
    fromTimeChange = QtCore.pyqtSignal()
    _fromDate = QtCore.QDate.currentDate()

    def __init__(self, fromDate, parent=None):
        QtCore.QAbstractListModel.__init__(self, parent)
        self._fromDate = fromDate

    def getFromTime(self):
        return QtCore.QDateTime(self._fromDate).toTime_t()

    fromTime = QtCore.pyqtProperty("int", fget=getFromTime, notify=fromTimeChange)
